package net.sunofbeach.blog.utils;

/**
 * 常量
 *
 * @author bing_  @create 2021/11/25-9:50
 */
public interface Constants {

    /**
     * 文章相关常量
     */
    interface Article {
        int TITLE_MAX_LENGTH = 128;
        int SUMMARY_MAX_LENGTH = 250;
        String TYPE_0 = "0";
        String TYPE_1 = "1";
        // 状态：0表示删除、1表示发布、2表示草稿、3表示置顶、4审核通过、5审核未通过、6待审核
        String STATE_DELETE = "0";
        String STATE_PUBLISH = "1";
        String STATE_DRAFT = "2";
        String STATE_TOP = "3";
        String STATE_PASS = "4";
        String STATE_FAIL = "5";
        String STATE_WAIT = "6";

    }

    interface Status {
        String NORMAL = "1"; // 状态：正常
        String DELETE = "0"; // 状态：正常
    }

    interface ImageType {
        String PREFIX = "image/";
        String JPG = "jpg";
        String JPEG = "jpeg";
        String PNG = "png";
        String GIF = "gif";
        String JPG_WITH_PREFIX = PREFIX + "jpg";
        String JPEG_WITH_PREFIX = PREFIX + "jpeg";
        String PNG_WITH_PREFIX = PREFIX + "png";
        String GIF_WITH_PREFIX = PREFIX + "gif";
    }

    interface User {
        String ROLE_ADMIN = "role_admin"; // 角色管理员
        String ROLE_NORMAL = "role_normal"; // 角色正常
        String DEFAULT_AVATAR = "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F202007%2F26%2F20200726094715_csmcm.thumb.1000_0.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1640397408&t=6f643c05fcc77bc8f4304d6c902fbe57"; // 默认头像
        String STATE_DEFAULT = "1"; // 默认状态 正常
        String STATE_DELETE = "0"; // 用户状态
        String COOKIE_TOKEN_KEY = "sob_blog_token"; // cookieKey

        // redis key
        String KEY_CAPTCHA_CONTENT = "key_captcha_content_"; // redis 图灵验证码 key
        String KEY_EMAIL_CODE_CONTENT = "key_email_code_content_"; // 邮箱验证码 key
        String KEY_EMAIL_SEND_IP = "key_email_send_ip_"; // 用户IP key
        String KEY_EMAIL_SEND_ADDRESS = "key_email_send_address_"; // 邮箱地址 key
        String KEY_TOKEN = "key_token"; // token key

    }

    interface Setting {
        // 初始化管理状态
        String MANAGER_ACCOUNT_INIT_STATE = "manager_account_init_state";
        // 网站设置
        String WEB_SIZE_TITLE = "web_size_title";
        String WEB_SIZE_DESCRIPTION = "web_size_description";
        String WEB_SIZE_KEYWORDS = "web_size_keywords";
        String WEB_SIZE_VIEW_COUNT = "web_size_view_count";
    }


    /**
     * 发送邮箱验证码类型：注册 register、找回密码 forget、修改邮箱 update
     */
    interface Email {
        String REGISTER = "register";
        String UPDATE = "update";
        String FORGET = "forget";
    }

    /**
     * 单位：秒
     */
    //interface TimeValue {
    //    int MIN = 60 * 1000; // 60秒
    //    int HOUR = 60 * MIN; // 1小时
    //    int HOUR2 = 60 * 60 * 2 * 1000 ; // 2小时
    //    int DAY = 24 * HOUR; // 1 天
    //    int WEEK = 7 * DAY; // 7 天
    //    int MONTH = 30 * DAY; // 30 天
    //}
}
